# import animal_demo
from animal_demo import Animal
from cat_demo import Cat

# cat = animal_demo.Animal("猫","大橘","雌","橘色")
cat = Animal("猫","大橘","雌","橘色")

# print(cat.type)
# print(cat.__color)
# print(animal_demo.Animal.type)
# print(Animal.type)
# print(Animal.__color)  # 私有化变量不能通过类名或对象名在类外直接访问

# cat.toString()  # 通过接口函数间接调用类的私有化变量

# cat.__speak()  # 私有化方法不能通过类名或对象名在类外直接访问
# cat.interface_demo()  # 通过接口函数间接调用类的私有化方法
#
# print(cat._Animal__color)
# print(cat._Animal__speak())

# print(cat.__color)

cat1 = Cat("猫","梨花","雄","狸花色")
print(cat1.type)
# print(cat1.__color)  # 子类不能继承父类的私有化变量
cat1.toString()
# cat1.__speak()  # 子类不能继承父类的私有化方法
cat1.cat_speak()
print(cat1.cat_ethnic)

